# -*- coding: utf-8 -*- 
# @Time : 2021/7/11 14:12 
# @Author : Dong 
# @File : demo01_compared_double_flask.py
# 两种方式打开 flask

from flask import Flask
from flask_restful import Api,Resource

app = Flask(__name__)
api = Api(app,default_mediatype="application/json")

class helloWorld(Resource):
    def get(self):
        return "helloworld"

api.add_resource(helloWorld,'/')

if __name__ == '__main__':
    app.run(debug=True)

'==============================================================='

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello World!'

if __name__ == '__main__':
    app.run(debug=True)
